class code3_2 {
    public int maxDepth(Node root) {
        if(root == null) return 0;
        Queue<Node> q = new LinkedList<>();
        int ret = 0;
        q.offer(root);

        while(!q.isEmpty()) {
            int sz = q.size();
            for(int i=0;i<sz;i++) {
                Node cur = q.poll();
                for(Node x:cur.children) {
                    q.offer(x);
                }
            }
            ret++;

        }
        return ret;
    }
}